//
//  DCUserInfo.m
//  Demo
//
//  Created by Kyle on 2022/12/31.
//

#import "DCUserInfo.h"

@implementation DCUserInfo

+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"register":@"registers"};
}

-(id)initWithCoder:(NSCoder *)decoder
{
    if(self = [super init])
    {
        self.userId  = [decoder decodeObjectForKey:@"userId"];
        self.token  = [decoder decodeObjectForKey:@"token"];
        self.refeshToken  = [decoder decodeObjectForKey:@"refeshToken"];
        self.phone  = [decoder decodeObjectForKey:@"phone"];
        self.registers  = [decoder decodeObjectForKey:@"registers"];
        
        self.extraAmountIsNotReminded  = [decoder decodeObjectForKey:@"extraAmountIsNotReminded"];
        self.locking  = [decoder decodeObjectForKey:@"locking"];
        self.realName  = [decoder decodeObjectForKey:@"realName"];
        self.repaymentRemainAmount  = [decoder decodeObjectForKey:@"repaymentRemainAmount"];
        self.repaymentTotalAmount  = [decoder decodeObjectForKey:@"repaymentTotalAmount"];
        self.total  = [decoder decodeObjectForKey:@"total"];
        self.unused  = [decoder decodeObjectForKey:@"unused"];
        self.used  = [decoder decodeObjectForKey:@"used"];
    }
    
    return self;
}

- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:self.userId forKey:@"userId"];
    [encoder encodeObject:self.token forKey:@"token"];
    [encoder encodeObject:self.refeshToken forKey:@"refeshToken"];
    [encoder encodeObject:self.phone forKey:@"phone"];
    [encoder encodeObject:self.registers forKey:@"registers"];
    
    [encoder encodeObject:self.extraAmountIsNotReminded forKey:@"extraAmountIsNotReminded"];
    [encoder encodeObject:self.locking forKey:@"locking"];
    [encoder encodeObject:self.realName forKey:@"realName"];
    [encoder encodeObject:self.repaymentRemainAmount forKey:@"repaymentRemainAmount"];
    [encoder encodeObject:self.repaymentTotalAmount forKey:@"repaymentTotalAmount"];
    [encoder encodeObject:self.total forKey:@"total"];
    [encoder encodeObject:self.unused forKey:@"unused"];
    [encoder encodeObject:self.used forKey:@"used"];

}

@end
